package ldh.im.fxbase.data.pojo.status;

import ldh.rpc.dto.ValueEnum;

public enum ImUserStatus implements ValueEnum<Byte> {
    enable(1, "可用"),
    disable(2, "不可用"),
    ;


    private Byte value;
    private String desc;

    private ImUserStatus(Integer value, String desc){
        this.value = value.byteValue();
        this.desc = desc;
    }

    @Override
    public Byte getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }


    public static ImUserStatus getByValue(Integer value) {
        if (value == null) return null;
        for (ImUserStatus departmentStatus : ImUserStatus.values()) {
            if (departmentStatus.getValue() == value.byteValue()) {
                return departmentStatus;
            }
        }

        throw new RuntimeException("ImUserStatus不支持这个值：" + value);
    }
}
